//
//  EntryProtectTargetPositionCell.m
//  MyProject
//
//  Created by 石小强 on 2018/4/24.
//  Copyright © 2018年 yanjiaming. All rights reserved.
//

#import "EntryProtectTargetPositionCell.h"

@implementation EntryProtectTargetPositionCell

- (void)setModel:(PositionModel *)model {
    _model = model;
    
    self.nameL.text = model.positionName;
    self.salaryL.text = [NSString stringWithFormat:@"【%@k-%@k】", model.minSalary, model.maxSalary];
    self.companyL.text = model.companyAbbreviatedName;
    self.addressL.text = [NSString stringWithFormat:@"%@-%@ | %@ | %@", model.regionName, model.workingPlaceTradingArea, model.requiredExperienceName, model.requiredEducationalName];
    if (model.isSelect == 1) {
        self.selectB.selected = YES;
    } else {
        self.selectB.selected = NO;
    }
}

- (IBAction)selectBtnClick:(id)sender {
    self.selectB.selected = !self.selectB.selected;
    
    if (self.selectB.selected) {
        self.model.isSelect = 1;
    } else {
        self.model.isSelect = 0;
    }
    if ([self.delegate respondsToSelector:@selector(selectBtnClickWithModel:andIndex:andIsSelect:)]) {
        [self.delegate selectBtnClickWithModel:self.model andIndex:self.index andIsSelect:self.selectB.selected ? 1 : 0];
    }
}


@end
